home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: hex to dec function?
- Date: 21 Feb 1996 13:40:48 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4gg3h0INN59e@keats.ugrad.cs.ubc.ca>
- References: <4gdh1b$bg@mailhost.mwmicro.com> <4gdolr$ha9@madeline.INS.CWRU.Edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4gdolr$ha9@madeline.INS.CWRU.Edu>,
- Michael A. Balfour <mab22@po.CWRU.Edu> wrote:
- >
- >In a previous article, aschlies@citynet.net () says:
- >
- >>Hi There,
- >>
- >>Is there a function that converts HEX to Dec in ANSI C?
- >>
- >You could try sscanf. For example:
- >
- >main()
- >{
- > char hex[9];
- > int dec;
- >
- > strcpy(hex,"FFFF");
-
- Of course, someone will change the above to " FFFFF", thus clobbering
- your activation record, since you comitted the hex array to hold only 9
- characters.
-
- There is no reason why you can't use char *hex = "FFFF"; in such a small
- example.
- --
-
-